home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Devastator / Devastator.jar / GameMIDlet.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-02-01  |  3.5 KB  |  197 lines

  1. import javax.microedition.lcdui.Display;
  2. import javax.microedition.midlet.MIDlet;
  3.  
  4. public class GameMIDlet extends MIDlet implements Runnable {
  5.    // $FF: renamed from: goto javax.microedition.lcdui.Display
  6.    private Display field_0;
  7.    // $FF: renamed from: try l
  8.    private l field_1;
  9.    // $FF: renamed from: for h
  10.    private h field_2;
  11.    // $FF: renamed from: new boolean
  12.    private boolean field_3 = true;
  13.    // $FF: renamed from: char int
  14.    private int field_4 = -1;
  15.    // $FF: renamed from: do int
  16.    private int field_5 = 0;
  17.    // $FF: renamed from: case boolean
  18.    private boolean field_6;
  19.    // $FF: renamed from: byte java.lang.Thread
  20.    private Thread field_7;
  21.    // $FF: renamed from: if java.lang.String
  22.    private final String field_8 = "MenuConfigName";
  23.    // $FF: renamed from: int java.lang.String
  24.    private final String field_9 = "GameConfigName";
  25.    // $FF: renamed from: a java.lang.String
  26.    private final String field_10 = "MenuModeName";
  27.    // $FF: renamed from: else java.lang.String
  28.    private final String field_11 = "GameModeName";
  29.  
  30.    public GameMIDlet() {
  31.       try {
  32.          this.field_0 = Display.getDisplay(this);
  33.          Object var1 = null;
  34.          String var2 = ((MIDlet)this).getAppProperty("MenuConfigName");
  35.          if (var2 != null) {
  36.             this.getClass();
  37.             var1 = Class.forName(var2).newInstance();
  38.          } else {
  39.             System.out.println("Warning: Menu mode config not defined");
  40.          }
  41.  
  42.          if (((MIDlet)this).getAppProperty("MenuModeName") == null) {
  43.             System.out.println("Error: Menu mode not defined");
  44.          }
  45.  
  46.          this.getClass();
  47.          this.field_2 = (h)Class.forName(((MIDlet)this).getAppProperty("MenuModeName")).newInstance();
  48.          this.field_2.a(this);
  49.          this.field_2.a(var1);
  50.          var2 = ((MIDlet)this).getAppProperty("GameConfigName");
  51.          if (var2 != null) {
  52.             this.getClass();
  53.             var1 = Class.forName(var2).newInstance();
  54.          } else {
  55.             System.out.println("Warning: Game mode config not defined");
  56.          }
  57.  
  58.          if (((MIDlet)this).getAppProperty("GameModeName") == null) {
  59.             System.out.println("Error: Game mode not defined");
  60.          }
  61.  
  62.          this.getClass();
  63.          this.field_1 = (l)Class.forName(((MIDlet)this).getAppProperty("GameModeName")).newInstance();
  64.          this.field_1.a(this);
  65.          this.field_1.a(var1);
  66.          this.field_2.a(this.field_1);
  67.          this.field_2.a(this.field_1.goto());
  68.          this.field_2.byte(this.field_1.char());
  69.       } catch (Exception var3) {
  70.          ((Throwable)var3).printStackTrace();
  71.          ((MIDlet)this).notifyDestroyed();
  72.       }
  73.  
  74.    }
  75.  
  76.    public void startApp() {
  77.       try {
  78.          if (this.field_3) {
  79.             this.field_0.setCurrent(this.field_2);
  80.             this.field_2.byte();
  81.             m.a();
  82.             this.field_4 = 0;
  83.          } else if (this.field_4 == 0) {
  84.             this.field_2.try();
  85.          } else {
  86.             this.field_1.try();
  87.          }
  88.       } catch (Exception var2) {
  89.          ((Throwable)var2).printStackTrace();
  90.          ((MIDlet)this).notifyDestroyed();
  91.       }
  92.  
  93.    }
  94.  
  95.    public void pauseApp() {
  96.       if (this.field_4 == 0) {
  97.          this.field_2.if();
  98.       } else {
  99.          this.field_1.if();
  100.       }
  101.  
  102.    }
  103.  
  104.    public void destroyApp(boolean var1) {
  105.       this.field_5 = 1;
  106.       this.field_1.a();
  107.       this.field_2.a();
  108.    }
  109.  
  110.    // $FF: renamed from: a (boolean) void
  111.    public void method_0(boolean var1) {
  112.       if (this.field_7 == null) {
  113.          this.field_6 = var1;
  114.          this.field_7 = new Thread(this);
  115.          this.field_7.start();
  116.       }
  117.  
  118.    }
  119.  
  120.    // $FF: renamed from: a () void
  121.    public void method_1() {
  122.       if (this.field_5 == 0) {
  123.          this.field_4 = 0;
  124.          boolean var1 = false;
  125.          if (this.field_1.new() && !this.field_1.goto()) {
  126.             this.field_1.do();
  127.             this.field_2.a(false);
  128.             this.field_2.byte(this.field_1.char());
  129.             if (this.field_2.byte(this.field_1.else(), this.field_1.case())) {
  130.                var1 = true;
  131.             }
  132.          } else if (!this.field_1.int()) {
  133.             this.field_1.if();
  134.             this.field_2.a(true);
  135.          } else {
  136.             this.field_2.a(true);
  137.          }
  138.  
  139.          this.field_0.setCurrent(this.field_2);
  140.          this.field_2.byte();
  141.          if (var1) {
  142.             this.field_2.try(this.field_1.else(), this.field_1.case());
  143.          }
  144.  
  145.       }
  146.    }
  147.  
  148.    // $FF: renamed from: if () void
  149.    public void method_2() {
  150.       if (this.field_4 == 1) {
  151.          this.method_1();
  152.       }
  153.  
  154.    }
  155.  
  156.    // $FF: renamed from: do () void
  157.    public void method_3() {
  158.       this.field_5 = 1;
  159.       if (this.field_4 == 0) {
  160.          this.field_2.do();
  161.       } else {
  162.          this.field_1.do();
  163.       }
  164.  
  165.       this.field_1.a();
  166.       this.field_2.a();
  167.       ((MIDlet)this).notifyDestroyed();
  168.    }
  169.  
  170.    public void run() {
  171.       this.field_2.do();
  172.       this.field_4 = 1;
  173.       if (this.field_6) {
  174.          if (!this.field_1.new() && !this.field_3) {
  175.             this.field_1.do();
  176.          }
  177.  
  178.          this.field_0.setCurrent(this.field_1);
  179.          this.field_1.if(this.field_2.b());
  180.          this.field_1.do(this.field_2.void());
  181.          this.field_1.byte();
  182.       } else {
  183.          this.field_0.setCurrent(this.field_1);
  184.          if (this.field_1.new()) {
  185.             this.field_1.if(this.field_2.b());
  186.             this.field_1.do(this.field_2.void());
  187.             this.field_1.byte();
  188.          } else {
  189.             this.field_1.try();
  190.          }
  191.       }
  192.  
  193.       this.field_3 = false;
  194.       this.field_7 = null;
  195.    }
  196. }
  197.